<% layout("/inc/layout_page.html"){ %>

<form action="${BASE}/admin/cms/CmsComment/save" id="form_save" method="post">
<div class="box">
  <div class="box-header">
    <h4 class="box-title"><i class="fa fa-bars"></i> 添加评论表</h4>
    <div class="box-tools">
      <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> 保存</button>
      <a href="javascript:;" onclick="layer_close()" class="btn btn-info btn-sm"><i class="fa fa-chevron-left"></i> 返回</a>
    </div>
  </div>
  <div class="box-body">
    <table class="table tform table-bordered">
      <tr>
        <th><label for="columnId">栏目编号：</label></th>
        <td><input id="columnId" name="columnId" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="columnSid">栏目SID：</label></th>
        <td><input id="columnSid" name="columnSid" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="articleId">文章编号：</label></th>
        <td><input id="articleId" name="articleId" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="articleSid">文章SID：</label></th>
        <td><input id="articleSid" name="articleSid" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="articleTitle">文章的标题：</label></th>
        <td><input id="articleTitle" name="articleTitle" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="articleUrl">原文地址：</label></th>
        <td><input id="articleUrl" name="articleUrl" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="content">评论内容：</label></th>
        <td><input id="content" name="content" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="userId">评论人编号：</label></th>
        <td><input id="userId" name="userId" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="userSid">评论人SID：</label></th>
        <td><input id="userSid" name="userSid" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="toUserId">被评论人编号：</label></th>
        <td><input id="toUserId" name="toUserId" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="toUserSid">被评论人SID：</label></th>
        <td><input id="toUserSid" name="toUserSid" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="userName">评论人姓名：</label></th>
        <td><input id="userName" name="userName" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="userEmail">评论者邮箱：</label></th>
        <td><input id="userEmail" name="userEmail" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="ip">评论人IP：</label></th>
        <td><input id="ip" name="ip" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="auditUserId">审核人：</label></th>
        <td><input id="auditUserId" name="auditUserId" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="auditDate">审核时间：</label></th>
        <td><input id="auditDate" name="auditDate" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="type">评论类型；1实名评论：</label></th>
        <td><input id="type" name="type" type="text" class="form-control"></td>
      </tr>
      <tr>
        <th><label for="parentid">被回复的评论id：</label></th>
        <td><input id="parentid" name="parentid" type="text" class="form-control"></td>
      </tr>

      <tr>
        <th><label for="remarks">备注信息：</label></th>
        <td>
        	<textarea id="remarks" name="remarks" cols="" rows="" class="form-control"  placeholder="备注信息...255个字符以内" dragonfly="true" onKeyUp="textarealength(this,255)"></textarea>
          <p class="textarea-numberbar"><em class="textarea-length">0</em>/255</p>
        </td>
      </tr>
    </table>
  </div>
  <div class="box-footer">
    <div class="box-tools pull-right">
      <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> 保存</button>
      <a href="javascript:;" onclick="layer_close()" class="btn btn-info btn-sm"><i class="fa fa-chevron-left"></i> 返回</a>
    </div>
  </div>
</div>
</form>

<script type="text/javascript">
$(function(){
	$("#form_save").validate({
		errorPlacement: function(error, element) {
			error.appendTo(element.parent());
		},
		submitHandler : function(form) {
			layer.load(1, {shade: [0.3,'#fff']});
			$(form).ajaxSubmit({
				dataType:"json",
				success:function( jsondata ){
					layer.closeAll('loading');
					if(jsondata.success){
						parent.toastr.success('保存成功！');
						parent.reload_table();
						layer_close();
					}else{
						parent.toastr.error(jsondata.msg);
					}
				}
			});
		},
		rules : {
			loginName : {
				required : true
			}
		}, 
		messages : { 
			name : { 
				required : "名称不能为空"
			}
		}
	});
});
</script>

<% } %>